package com.ruoyi.system.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.ExchangeMapper;
import com.ruoyi.system.domain.Exchange;
import com.ruoyi.system.service.IExchangeService;
import com.ruoyi.common.core.text.Convert;

/**
 * 积分兑换 服务层实现
 * 
 * @author ruoyi
 * @date 2019-08-07
 */
@Service
public class ExchangeServiceImpl implements IExchangeService 
{
	@Autowired
	private ExchangeMapper exchangeMapper;

	/**
     * 查询积分兑换信息
     * 
     * @param id 积分兑换ID
     * @return 积分兑换信息
     */
    @Override
	public Exchange selectExchangeById(Long id)
	{
	    return exchangeMapper.selectExchangeById(id);
	}
	
	/**
     * 查询积分兑换列表
     * 
     * @param exchange 积分兑换信息
     * @return 积分兑换集合
     */
	@Override
	public List<Exchange> selectExchangeList(Exchange exchange)
	{
	    return exchangeMapper.selectExchangeList(exchange);
	}
	
    /**
     * 新增积分兑换
     * 
     * @param exchange 积分兑换信息
     * @return 结果
     */
	@Override
	public int insertExchange(Exchange exchange)
	{
	    return exchangeMapper.insertExchange(exchange);
	}
	
	/**
     * 修改积分兑换
     * 
     * @param exchange 积分兑换信息
     * @return 结果
     */
	@Override
	public int updateExchange(Exchange exchange)
	{
	    return exchangeMapper.updateExchange(exchange);
	}

	/**
     * 删除积分兑换对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
	@Override
	public int deleteExchangeByIds(String ids)
	{
		return exchangeMapper.deleteExchangeByIds(Convert.toStrArray(ids));
	}
	
}
